#define  _IPC_EXCHANGE_GLOBAL_
#include "carDef.h"
#include "config.h"
#include<string.h>
void ipcExchangeEvent(ULONG enumWhatEvent,ULONG lPara,BYTE *p,ULONG length)
{
	if (enumWhatEvent > EVENT_GLOBAL_AUTO_CLR_MIN && enumWhatEvent < EVENT_GLOBAL_AUTO_CLR_MAX)
	{
		ipcEventProcDemoDebug(enumWhatEvent,lPara,p,length);	

	}
	else 
	{
		ipcClearEvent(enumWhatEvent);
	}
}

void ipcStartEvent(ULONG enumWhatEvent,ULONG lPara,BYTE *p,ULONG length)
{
	sbi(ipcExchangeInfo.EventSet[enumWhatEvent/32], enumWhatEvent%32);

	ipcExchangeEvent(enumWhatEvent,lPara,p,length);
}

void ipcClearEvent(UINT32 sourceEvent)
{
	cbi(ipcExchangeInfo.EventSet[sourceEvent/32], sourceEvent%32);
}

BOOL ipcWhatEventOn(UINT32 sourceEvent)
{
	return bit_is_set(ipcExchangeInfo.EventSet[sourceEvent/32], sourceEvent%32);
}

void ipcExchangeInit(void)
{
	memset(&ipcExchangeInfo,0,sizeof(IPC_EXCHANGE_INFO));
}
